// 理解包装对象(类似于Java中的包装类)

// true 和 false 是原始类型 boolean 的两个字面量
const primitive = true ;
console.log( primitive , typeof primitive );

// 创建一个Boolean实例并在其中包裹指定的原始值
const wrapper = new Boolean( primitive );
console.log( wrapper , typeof wrapper );

// 获得在Boolean实例中所包裹的原始值
const prim = wrapper.valueOf();
console.log( prim , typeof prim );

console.log( '- - - - - - - - - - - - - - - - - - - - - - - - -' );

let x = new Boolean();
console.log( x , typeof x );

x = new Boolean( null );
console.log( x , typeof x );

x = new Boolean( undefined );
console.log( x , typeof x );

x = new Boolean( 0 );
console.log( x , typeof x );

x = new Boolean( '' );
console.log( x , typeof x );

x = new Boolean( NaN );
console.log( x , typeof x );

x = new Boolean( false );
console.log( x , typeof x );

x = new Boolean( [ ] );
console.log( x , typeof x );

x = new Boolean( { } );
console.log( x , typeof x );